import torch

# def test():
#     print("test")
#     embed = torch.load("./shoulders/dino_embeddings/dino_embed_video.pt", map_location=torch.device('cpu'))
    
#     print(embed.shape)

import torchvision.transforms as transforms
from PIL import Image
import matplotlib.pyplot as plt

def test_resize_image():
    # 定义图像路径，这里需要替换为你实际的图像路径
    image_path = './shoulders/shoulders00001.jpg'

    # 打开图像
    image = Image.open(image_path)

    # 定义目标大小
    h = 476
    w = 854

    # 定义转换操作
    transform = transforms.Compose([
        transforms.Resize((h, w), interpolation=Image.LANCZOS),
        transforms.ToTensor()
    ])

    # 应用转换
    resized_image = transform(image)

    # 将张量转换为numpy数组并调整维度
    resized_image_np = resized_image.permute(1, 2, 0).numpy()

    # 显示图像
    plt.imshow(resized_image_np)
    plt.axis('off')
    plt.show()
    
    
if __name__ == '__main__':
    # test()
    test_resize_image()